﻿using System.Threading.Tasks;
using KL.UFrame.Core.Result;
using KL.UFrame.Data.Models;

namespace KL.UFrame.Data.Business
{
    public interface IAccountBusiness
    {
        Task<AccountInfoModel> GetUserInfoAsync(string userName);

        Task<int> UpdateNameAsync(string userId, string newName);

        Task<ResultMessage> UpdateEmailAsync(string userId, string newEmail);

        Task<int> UpdateHeadAsync(string userId, string headUrl);

        Task<bool> ValidateUserWithEmailAsync(string userName, string email);

        bool IsInRole(string userId, string role);

        bool IsInRole(string userId, string[] roles);

        string[] GetUserRoleNames(string id, bool force = false);

        Task<string[]> GetUserRoleIdsAsync(string userId);

        Task<int> ToggleUserRoleAsync(string userId, string roleId);
    }
}